package org.dromara.netbar.mapper;

import org.apache.ibatis.annotations.Param;
import org.dromara.netbar.domain.NetbarCouponMember;
import org.dromara.netbar.domain.vo.NetbarCouponMemberVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;

import java.util.List;
import java.util.Map;

/**
 * 会员-卡券关联Mapper接口
 *
 * @author Lion Li
 * @date 2025-07-15
 */
public interface NetbarCouponMemberMapper extends BaseMapperPlus<NetbarCouponMember, NetbarCouponMemberVo> {

    /**
     * 根据会员ID查询会员-卡券关联
     */
    List<NetbarCouponMemberVo> selectCouponMemberByMemberIds(List<Long> memberIds);
    /**
     * 根据会员ID查询会员-卡券关联（根据卡券ID分组返回卡券数量）
     */
    List<NetbarCouponMemberVo> selectCouponMemberGroupByMemberIds(@Param("memberIds") List<Long> memberIds,@Param("nowDate") String nowDateStr);

    Map<Long, Integer> countMapByCouponIds(Long[] couponIds);

    List<NetbarCouponMemberVo> selectDjqListByBalance(@Param("memberId") Long memberId,@Param("balance") Long balance, @Param("couponType") String couponType, @Param("nowDate") String nowDateStr);

    List<NetbarCouponMemberVo> selectListCouponMemberByCouponMemberIds(@Param("ids") List<Long> useCouponMemberIds,@Param("couponType") String couponType, @Param("nowDate") String nowDateStr);
}
